package tcm.com.gistone.database.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import tcm.com.gistone.database.entity.Theme;

public interface ThemeMapper {
    int deleteByPrimaryKey(Long themeId);

    int insert(Theme record);

    int insertSelective(Theme record);

    Theme selectByPrimaryKey(Long themeId);

    int updateByPrimaryKeySelective(Theme record);

    int updateByPrimaryKey(Theme record);

    @Select("select * from tb_theme")
    @ResultMap("tcm.com.gistone.database.mapper.ThemeMapper.BaseResultMap")
    List<Theme> selectAll();

    @Select("select theme_name from tb_theme where special_id = #{specialId}")
    List<String> selectNameBySpecial(long specialId);

    @Select("select * from tb_theme where special_id = #{specialId}")
    @ResultMap("tcm.com.gistone.database.mapper.ThemeMapper.BaseResultMap")
    List<Theme> selectThemeBySpecial(long specialId);

    @Select("select * from tb_theme where special_id = #{specialId} and theme_name = #{name}")
    @ResultMap("tcm.com.gistone.database.mapper.ThemeMapper.BaseResultMap")
    Theme selectOne(@Param("specialId") long specialId, @Param("name") String name);

}